Skip to content

Conversation

@Joy-less
Copy link
Contributor

Since char is a 16-bit UTF-16 character, it doesn't support characters outside the BMP encoding range and need to be combined as surrogate pairs.
Rune is essentially a 32-bit UTF-32 character, and can support all Unicode characters, including emojis. It's wonderful.

This PR adds:

  • ValueStringBuilder.Append(Rune)
  • ValueStringBuilder.AppendJoin(Rune, IEnumerable<string?>)
  • ValueStringBuilder.AppendJoin<T>(Rune, IEnumerable<T>)

This PR also optimises AppendLine(scoped ReadOnlySpan<char>) by avoiding an unnecessary string allocation. It also removes an unnecessary null check in AppendJoinInternalString<T>(ReadOnlySpan<char>, IEnumerable<T>).

@linkdotnet
Copy link
Owner

Hey @Joy-less
I love it - thank you very much for the PR and especially for fixing my stupid English grammar mistakes! Really appreciated.

One last bid:
Could you add a new ## Added section explaining what you did in the CHANGELOG.md.
This file is used for generating release notes.

@Joy-less
Copy link
Contributor Author

One last bid: Could you add a new ## Added section explaining what you did in the CHANGELOG.md. This file is used for generating release notes.

Done! :)

@sonarqubecloud
Copy link

@linkdotnet linkdotnet merged commit 8a87e6a into linkdotnet:main Jan 11, 2025
3 checks passed
@Joy-less Joy-less deleted the add-runes branch January 11, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants